package com.gusto.engine.colfil.matrix;

import java.util.Collection;
import java.util.List;

import com.gusto.engine.colfil.Prediction;
import com.gusto.engine.colfil.Rating;

/**
 * <p>{@link MatrixDAO} Interface provides the methods to access the evaluation matrix<br/>
 * By providing methods for: <br/>
 * <ul>
 * 	<li>Inserting Ratings/Predictions
 * 	<li>Getting Ratings/Predictions
 * 	<li>Items Rated by a User / Users having rated an Item
 * 	<li>User/Item Mean rating
 * 	<li>Getting the Matrix and a SubMatrix of evaluations
 * </ul>
 * 
 * @author amokrane.belloui@gmail.com
 * 
 */
public interface MatrixDAO {
	
	public void insertRating(long userId, long itemId, Rating rating, boolean checkExistence);
	public void insertPrediction(long userId, long itemId, Prediction prediction);
	
	public Rating getRating(long userId, long itemId);
	public Prediction getPrediction(long userId, long itemId);
	
	public List<Rating> getItemsRatedByUser(long userId, boolean normalized);
	public List<Rating> getUsersHavingRatedItem(long itemId, boolean normalized);
	
	public double getUserMeanRating(long userId);
	public double getItemMeanRating(long itemId);
	
	//public List<Rating> getMatrix();
	public List<Rating> getSubMatrix(Collection<Long> usersIds, Collection<Long> itemsIds);
	
}
